<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>收费页面</title>
<style type="text/css">
<!--
.STYLE5 {font-size: 16px;}
-->
</style>
<script language="JavaScript">
  function docash(){  
     
     document.form1.expense.disabled = true;
     var cashTotal = document.form1.money.value;
     var orderNum = document.form1.orderNum.value;
     var com = document.form1.com.value;
     var number = document.form1.number.value;        
     document.posApplet.setCashTotal( cashTotal );
     document.posApplet.setOrderNum( orderNum );
     document.posApplet.setCom( com );
     document.posApplet.setTERMINAL_NUM( number );
     document.posApplet.doCash();
     alert("不能连续点两次收费按钮！");
     alert("请刷卡!");
    /*
     document.posApplet.setDataDomainStr();
     alert("请刷卡!");
 	 document.posApplet.doCash();
 	*/ 	
 	 
  //   document.posApplet.repaint();    
  }
  
  function setResult(){  
  
    /*
     document.posApplet.setDataDomainStr();
     alert("请刷卡!");
 	 document.posApplet.doCash();
 	*/
 	 var cashTotal = document.form1.money.value;
 	 var str =  document.posApplet.getPosReturn(); 	 
 	 alert(str);
 	 
 	 document.form1.money.value = document.posApplet.getCashTotal();
 	 document.form1.cardNo.value = document.posApplet.getCardNum();
 	 document.form1.serialNo.value = document.posApplet.getSeriaNum();
 	 document.form1.seriaNumRef.value = document.posApplet.getSeriaNumRef();
 	 
 	 var status = document.posApplet.getStatus();
 	 
 	 if(status == "00")
 	      document.form1.info.value = "交易成功";
 	 else{ 
 	      document.form1.info.value = "交易不成功";
 	      document.form1.money.value = cashTotal;
 	 }
 	 
 	 document.form1.expense.disabled = false;
 	 document.form1.again.disabled = false;
  
  }
  
   function againcash(){
   
     document.form1.again.disabled = true;
     var cashTotal = document.form1.money.value;
     var orderNum = document.form1.orderNum.value;
     var com = document.form1.com.value;
     var number = document.form1.number.value; 
     var status = document.posApplet.getStatus();
     
     document.posApplet.setCashTotal( cashTotal );
     document.posApplet.setOrderNum( orderNum );
     document.posApplet.setCom( com );
     document.posApplet.setTERMINAL_NUM( number );
     document.posApplet.setFlag("false");
     document.posApplet.setDataDomainStr();     
 	 document.posApplet.doCash();
 	      
  //   document.posApplet.repaint();    
  }

function doZip(){

	var inputFilename = "d:/wst";
	var zipFilename = "d:/wst.zip";
	document.posApplet.zip(inputFilename, zipFilename);

}

function doUnZip(){

	var zipFilename = "d:/wst.zip";
	var outputDirectory = "d://wst";
	document.posApplet.unzip(zipFilename, outputDirectory);

}
  </script>
</head>
<body>
<form name="form1" method="post" action="">
<input type="hidden" name="orderNum" value="121213217 ">
<applet name="posApplet"  type="applet" code="testdevice.pos.PosApplet" archive="posApplet.jar;comm.jar;"  width="120" height="120" ="mayscript">   
</applet> 
<fieldset class="STYLE5" ><legend>设备参数选 择</legend> <br>
<table width="56%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr><td width="31%">    
    端口:
        <select name="com">
      <option value="COM1" selected="selected">COM1</option></select></td>
    <td width="31%">速率   ：
      <select name="rate"><option value="9600" selected="selected">9600</option></select>  </td>
	<td width="38%">终端号：
      <select name="number"><option value="63000971" selected="selected">63000971</option></select> </td>      
    </tr>
</table>
<br>
</fieldset>
<br>
<br>
<table width="67%" border="0" align="left" cellpadding="0" cellspacing="0" class="STYLE1">
<tr><td width="58%" class="STYLE5">
  <p>收费金额：
    <input type="text" name="money" size="14" value="1"/>(分）
  </p>
  <p>&nbsp; </p></td>   
</tr>
<p class="STYLE5">&nbsp;</p>
<tr valign="top"><td class="STYLE5"><p>卡号：
  <input type="text" name="cardNo" size="21" />
</p>
    <p>&nbsp; </p></td>
<td width="42%" class="STYLE5">交易流水号：
  <input type="text" name="serialNo" size="10" /></td></tr>
  <tr class="green">
    <td height="22" nowrap>交易参考号:
      <input name="seriaNumRef" type="text" id="seriaNumRef" /></td>
    <td>&nbsp;</td>
  </tr>
<tr><td class="STYLE5"><p>返回信息：
  <input type="text" name="info" size="20" />
</p>
    <p>&nbsp; </p></td></tr>
<tr></tr>
</table>
<p class="STYLE5">&nbsp;</p>
<p class="STYLE5">&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="STYLE5">
<tr align="center"><td><input type="button" name="expense" value="收费" onclick="docash()">/</td>
<td></td>
<td>&nbsp;</td>
<td><input type="button" name="again" value="补登" onclick="againcash()"></td><td></td>
<td>&nbsp;</td>
<td><input type="button" name="comeback" value="返回"> /<input type="button" name="doZipBtn" value="测试压缩" onclick="doZip()">/<input type="button" name="doUnZipBtn" value="解压缩" onclick="doUnZip()"></td>
<td></td>
<td></td>
<td>&nbsp;</td>
<td></td>
</tr>
</table>
 <p></p>
<p>&nbsp;</p>
</form>
</body>
</html>
